package com.briup.service.impl;

import com.briup.bean.ShopAddress;
import com.briup.dao.ShopAddressMapper;
import com.briup.service.IShopAddressService;
import com.briup.util.MyBatisSqlSessionFactory;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author 王若龙
 * @CreateTime 2022-09-27 14:11
 */
public class IShopAddressServiceImpl implements IShopAddressService {

    SqlSession sqlSession = MyBatisSqlSessionFactory.openSession(true);
    private ShopAddressMapper shopAddressMapper = sqlSession.getMapper(ShopAddressMapper.class);

    @Override
    public List<ShopAddress> findAddressByCustomerId(Integer id) {
        sqlSession.clearCache();
        return shopAddressMapper.findAddressByCustomerId(id);
    }

    @Override
    public void saveAddress(ShopAddress sd) {
        shopAddressMapper.saveAddress(sd);
    }
}
